1388B Captain Flint and a Long Voyage codeforces solution in cpp
by ujjal roy
#include<bits/stdc++.h>
using namespace std;
main()
{
int t,n;
cin>>t;
while(t--)
{
int ans;
cin>>n;
if(n%4==0) ans=n/4;
else ans=n/4+1;
for(int i=0;i<n-ans;i++) cout<<"9";
for(int i=0;i<ans;i++) cout<<"8";
cout<<endl;
}
return 0;
}
0 Comments